﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNet.Random.Abstract
{
    /// <summary>
    /// int类型 rand 抽象类 主要用于随机int类型的基类
    /// </summary>
    public abstract class IntAbsRandService : DotNet.Random.Interface.IIntRandService
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="IntAbsRandService" /> class.
        /// </summary>
        public IntAbsRandService()
        {
            this.Build = new BuildRandService();
            this.Serial = new List<int>();
        }

        /// <summary>
        /// Gets or sets the serial.
        /// 序列组
        /// </summary>
        /// <value>
        /// The serial.
        /// </value>
        public IList<int> Serial { get; set; }

        /// <summary>
        /// Gets or sets the build.
        /// 选取序列属性
        /// </summary>
        /// <value>
        /// The build.
        /// </value>
        protected BuildRandService Build { get; set; }

        /// <summary>
        /// Rands this instance.
        /// 随机生成数字方法
        /// 映射到虚方法中，扩展时，可重写
        /// </summary>
        /// <returns>
        /// 返回int类型
        /// </returns>
        public abstract int Rand();
    }
}
